package com.zjj.lbw.microservice.gateway.user.controller;

import com.zjj.lbw.common.bean.R;
import com.zjj.lbw.service.api.order.feign.GatewayFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanglei.zjj
 * @description 微服务—rpc-测试feign调用
 * @date 2023/7/6 22:10
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private GatewayFeignClient gatewayFeignClient;

    @RequestMapping(value = "/findOrderByUserId/{id}")
    public R findOrderByUserId(@PathVariable("id") Integer id) {
        // feign调用
        R result = gatewayFeignClient.findOrderByUserId(id);
        return result;
    }
}
